
% % % 
[b, a]=sos2tf(SOS,G); 

g_temp = g_a2;
fg_a1 = filter(b, a, g_temp);
fg_err_a1 = fg_a1 - g_temp;
max_err_a1 = max(fg_err_a1);
max_fg_e_a1 = max(fg_a1);
max_g_a1 = max(g_temp);
figure();
plot(G_Temp_time,fg_a1);
TiltleName4 = ['gtm a',num2str(1), ' Max torque ',num2str(max_fg_e_a1)];
title(TiltleName4);

    
figure();
% % % 
fs = 250;
f = (0:L-1)*(fs/L);


y = fft(fg_a1);
L = length(fg_a1);
amplitude = abs(y)*2/L;

subplot(1,2,1);
% figure();
plot(f(1:floor(L/2)),amplitude(1:floor(L/2)));

% % % % % 
subplot(1,2,2);
y = fft(g_temp);
L = length(g_a1);
amplitude = abs(y)*2/L;

% figure();
plot(f(1:floor(L/2)),amplitude(1:floor(L/2)));